Method, system for transmitting document over network, virtual printer apparatus and restoration apparatus

ABSTRACT

The present invention discloses a method system for transmitting a document over a Network including the steps of a document sender converts a sharing document to be transmitted into a GDI (Graph Device Interface) document by performing virtual printing. The document receiver receives the graph device interface document sent from the document sender through the network The document receiver restores the received GDI document. The contents of the restored GDI document are the same as that of the sharing document. The present invention also provides a system, a virtual printer apparatus and a restoration apparatus, the transmission of the document is not restricted by the application using the method, system and apparatus of the present invention.

CROSS-REFERENCE TO RELATED APPLICATIONS

This is a national stage of International Application No.PCT/CN2005/002196, filed on Dec. 15, 2006, which claims priority ofChinese Patent Application No. 200410101342.9 filed Dec. 17, 2004, thedisclosure of which is hereby incorporated by reference in its entirety.

FIELD OF THE TECHNOLOGY

The present invention relates to network communication technologies, andmore particularly, to a method and a system for transmitting a documentover a network, a virtual printer apparatus and a restoration apparatus.

BACKGROUND OF THE INVENTION

With the development of the Internet and mobile communicationtechnologies, people may perform such communication as data exchange andmessage interaction, using a method, e.g., a Local Area Network (LAN),an e-mail and an Instant Messenger (IM) tool. Data exchange includesdocument transmission, application sharing, and audio and videodocuments sharing. The document transmission refers to sending, by adocument sender, a sharing document to a document receiver using such amethod as logging on another computer, using attachment of an e-mail,and using an IM tool. Here, the document refers to a document containingonly text and pictures, such as a Word document, an Excel tabledocument, an AutoCAD drawing document and a Photoshop graph document. Toview the contents of a sharing document normally, the document receivermust have applications associated with the sharing document installed.In order to reduce the types of the applications to be installed on adocument receiver, the above sharing document may also be converted intoa document of PDF format. However, in such a case, the PDF documentstill cannot be read if the document receiver has not had thecorresponding application installed.

Usually, people transmit a document using an IM client on a computer ora mobile terminal. A process for transmitting a sharing document with anIM tool, in which an IM user A serves as a document sender and an IMuser B serves as a document receiver, is hereinafter described indetail.

FIG. 1 is a flow chart of the conventional method for transmitting asharing document with an Internet IM tool. As shown in FIG. 1, when bothan IM user A and an IM user B use an Internet IM tool, the method fortransmitting a sharing document with the IM tool includes the followingsteps of.

Step 101: the IM user A selects a document to be shared.

In this step, the IM user A selects the document to be shared with theIM user B, such as a text document, a Word document, an AutoCAD documentand an Excel document, from the documents stored in a computer to the IMuser A.

Steps 102˜103: the IM user A requests the IM server for the InternetProtocol (IP) address and port of the IM user B; the IM server returnsthe IP address of the IM user B to the IM user A.

A unique identifier, such as a user name, a user number, or an e-mailaddress of the IM user B, is carried in the request for the IP addressand the port sent from the IM user A to the IM server. Then, with theunique identifier of the IM user B as the index, the IM server finds outthe current IP address and port to the IM user B and returns them to theIM user A.

Step 104: the IM user A tries to connect the IM user B according to theacquired IP address and port.

In this step, the IM user A sends, according to the IP address and portacquired from the IM server, a connection request to the IM user B totry to establish a connection with the IM user B.

Step 105: the IM user A verifies whether the connection to the IM user Bsucceeds, and performs Step 106 if yes; otherwise, proceeds to Step 107.

In this step, if the IM user A receives a response of the IM user Bbefore a timer of the IM user A expires, the IM user A deems that he hassucceeded in connecting with the IM user B; otherwise, the IM user Adeems that he cannot connect with the IM user B.

In general, if the IM user B is in a public network or a firewall of theIM user B is weak, the IM user A can connect with the IM user Bdirectly. In other cases, the IM user A cannot connect with the IM userB directly.

Step 106: the IM user A transmits the document to the IM user B andperforms Step 109.

Since the IM user A may directly establish the connection with the IMuser B, in this step, the IM user A directly sends the document selectedin Step 101 to the IM user B.

Steps 107˜108: the IM user A sends the document to the IM server andrequests the IM server to send the document to the IM user B; then, theIM server sends, based upon the IP address and port of the IM user B,the document coming from the IM user A to the IM user B, and performsStep 109.

Step 109: the IM user B checks and views the received document.

In this step, after receiving the document sent from the IM user A, theIM user B opens the document using software associated with the documentand checks and views the contents of the document. Thus, an objective ofsharing the same document with the IM user A is achieved. For example,if what the IM user A sent is a Word document, the IM user B opens theWord document using software, such as an Office or a WordPad.

What is described above is a process of transmitting a sharing documentbetween the IM user A and the IM user B using the Internet IM tool. Ofcourse, the sharing document may also be transmitted by using a wirelessIM tool used in an intelligent cell phone. The description ishereinafter presented with the example in which the IM user A uses awireless IM tool while the IM user B uses an Internet IM tool.

FIG. 2 shows a flow chart of a conventional method for transmitting asharing document with the Internet or an IM tool. As shown in FIG. 2,the method for transmitting a sharing document between an IM user Ausing a wireless IM tool and an IM user B using an Internet IM toolincludes the following steps.

Step 201: an IM user A selects a document to be shared.

In this step, the IM user A selects the document to be shared with theIM user B, such as a text document, a Word document, an AutoCAD documentand an Excel document, from the documents stored in the computer to theIM user A.

Step 202: the IM user A sends the document to an IM server through awireless gateway and requests the IM server to send the document to theIM user B.

In this step, a mobile terminal used by the IM user A routes to thewireless gateway first, and meanwhile, the document and a request forsending the document are sent to the wireless gateway; then, thewireless gateway sends the received document and the request for sendingthe document to the IM server. A unique identifier of the IM user B iscarried in the request for sending the document of the IM user A.

Step 203: the IM server sends the document to the IM user B.

In this step, the IM server searches out, based on the unique identifierof the IM user B, an IP address and port of the IM user B, and sends thedocument to the IM user B.

Step 204: the IM user B checks and views the received document.

In this step, after receiving the document sent from the IM user A, theIM user B opens the document using software associated with thedocument, checks and views the contents of the document. Thus, anobjective of sharing the same document with the IM user B is achieved.For example, if what the IM user A sent is a Word document, the IM userB opens the Word document using software, such as an Office or aWordPad.

Thus, a process for transmitting a sharing document between the IM userA and the IM user B is completed.

If both the IM user A and the IM user B log on a wireless IM clientthrough an intelligent cell phone, in order that a sharing document istransmitted from the IM user A to the IM user B, the IM server firstsends the document to a wireless gateway after Step 202, and thewireless gateway sends the document to the IM user B.

Likewise, in the case that the IM user A uses an Internet IM tool whilethe IM user B uses a wireless IM tool, in order that a sharing documentis transmitted from the IM user A to the IM user B, the IM user A firstsends the document to the IM server, and the IM server sends thedocument to the IM user B through a wireless gateway.

In the above method for transmitting a sharing document with an IM tool,a document receiver must have had the software associated with thedocument installed in the computer or mobile terminal to the documentreceiver so as to open a received document and then view and check thecontents of the document; the document receiver cannot open and lookover the received document if the software associated with the documenthas not been installed in the computer or the mobile terminal to thedocument receiver. Moreover, if a version of the software installed inthe computer or mobile terminal to the document receiver differs fromthat of the software with which the document was edited, inconsistencyin positions of characters and pictures between the document andoriginal ones may occur, which influences a user reading the sharingdocument normally.

Likewise, in the case that a sharing document is transmitted using suchmode as a LAN or an e-mail, the document receiver must also have had theapplication associated with the sharing document installed in thecomputer or mobile terminal, and otherwise, the sharing document can notbe read normally.

SUMMARY OF THE INVENTION

In view of the above, objective of the present invention is to provide amethod, a system for transmitting a document over a Network, a virtualprinter apparatus and a restoration apparatus so as to enable a documentreceiver to view contents of a document in the case that the documentreceiver has not had software associated with the sharing documentinstalled.

The embodiments of the present invention provides a method fortransmitting a document over a Network, and the method includes thesteps of:

converting, a sharing document to be transmitted into a GDI (GraphDevice Interface) document by performing virtual printing;

receiving, by a document receiver the GDI document sent from a documentsender through a network;

restoring, by the document receiver, the received GDI document, whereincontents of the restored GDI document are same as that of the sharingdocument.

The present invention also provides a system for transmitting a documentover a Network, comprising: a document sender and a document receiver;and further comprising: a virtual printer module and a restorationmodule.

The document sender is used for outputting a sharing document to be sentto the virtual printer module, receiving a GDI document into which thesharing document is converted from the virtual printer module andsending the GDI document to the document receiver.

The virtual printer module is used for receiving a sharing document fromthe document sender, performing virtual printing to convert the sharingdocument into the GDI document, and outputting the GDI document to thedocument sender.

The restoration module is used for receiving a GDI document from thedocument receiver, restoring the same GDI document, wherein contents ofthe restored GDI document are same as that of the sharing document fromthe GDI document, and outputting the contents to the document receiver.

The document receiver is used for receiving a GDI document from thedocument sender, outputting the GDI document to the restoration module,and receiving the same contents as the sharing document sent from therestoration module.

The embodiments of the present invention also provide a virtual printerapparatus, comprising: a document sender; and further comprising: avirtual printer module; the document sender is used for outputting asharing document to be sent to the virtual printer module, receiving theGDI document into which the sharing document is converted from thevirtual printer module and sending the GDI document to a documentreceiver; the virtual printer module is used for receiving a sharingdocument from the document sender, performing virtual printing toconvert the sharing document into a GDI document, and outputting the GDIdocument to the document sender.

The embodiments of the present invention also provide a restorationapparatus, comprising: a document receiver, and further comprising: arestoration module; the restoration module is used for receiving a GDIdocument from the document receiver, restoring GDI document, whereincontents of the restored GDI document are same as that of the sharingdocument, and outputting the restored GDI document to the documentreceiver; the document receiver is used for receiving a GDI documentfrom a document sender, outputting the GDI document to the restorationmodule, and receiving the restored GDI document which has the samecontents as the sharing document sent from the restoration module.

The embodiments of the present invention also provide a method forsending a document over a Network, comprising the steps of converting,by a document sender, a sharing document to be transmitted into a GDI(Graph Device Interface) document by performing virtual printing;sending, by the document sender, the GDI document to a document receiverthrough a network.

The embodiments of the present invention also provide a method forreceiving a document over a Network, comprising the steps of receiving,by a document receiver, a GDI document sent from a document senderthrough a network, wherein the GDI document is converted from a sharingdocument; restoring, by the document receiver, the received GDIdocument, wherein contents of the restored GDI document are same as thatof the sharing document.

With the present invention, the receiver of the sharing document mayview the contents of the sharing document all the same in the case thatthe receiver has not had the software associated with the documentinstalled. Specifically, the present invention has the followingbenefits:

1. since all operating systems with a graph operating interface includea graph device interface (GDI) subsystem and the subsystem providesmultiple GDI functions for being called by the applications in theoperating system, in the present invention, the GDI document convertedfrom a sharing document is transmitted and the document receiver mayrestore the contents of the sharing document only by performing the GDIinstructions in the GDI document orderly with the existing GDIsubsystem, that is, the document receiver may succeed in viewing thesharing document without the need of having any associated applicationinstalled, which reduces the difficulty for the document receiver inreading the contents of the sharing document;

2. since GDI functions have the strong function of supporting vectordata and non-vector data at the same time, the converted GDI document isthe same as the sharing document in aspects, such as color and lines,that is, the consistency between the GDI document and the sharingdocument is better.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a flow chart of a conventional method for transmitting asharing document with an Internet IM tool;

FIG. 2 shows a flow chart of a conventional method for sharing adocument with the Internet or an IM tool;

FIG. 3 shows a flow chart of a preferred embodiment according to thepresent invention;

FIG. 4 shows a flow chart of the method for generating a GDI documentaccording to embodiment of FIG. 3;

FIG. 5 shows a flow chart of the method for generating a GDI instructionstream according to embodiment of FIG. 4;

FIG. 6 shows a flow chart of the operation of restoring a received GDIdocument according to embodiment of FIG. 3.

FIG. 7 is a schematic diagram illustrating the composition structure ofa preferred embodiment of the system of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

In order to make the objectives and technical solution of the presentinvention clearer, a detailed description of the present invention ishereinafter given with reference to the drawings and embodiments.

FIG. 3 shows a flow chart of a preferred embodiment according to thepresent invention. As shown in FIG. 3, the method includes the followingsteps.

Step 301: a document sender selects a document to be shared.

In this step, the document sender selects the document to be shared witha document receiver, such as a text document, a Word document, anAutoCAD document and an Excel document, from the documents stored in acomputer or mobile terminal to the document sender.

Step 302: the document sender converts the sharing document into a GDIdocument by executing virtual printing.

A GDI is a subsystem of an operating system with graphic interface andused for implementing output of a specific hardware. Specifically, theGDI accepts a graphing request sent by such an application as the Officeand the AutoCAD, through calling a GDI function, and sends the GDIfunction to a corresponding device driver so as to execute the output ofthe specific hardware, such as a printer and a screen.

In the present invention, a virtual printer module is established in aterminal of the network to the document sender and used for cooperatingwith the application to perform the virtual printing of a sharingdocument. The virtual printing refers to sending, by an application, GDIfunctions corresponding to the sharing document to a virtual printermodule according to contents of the sharing document, and the virtualprinter module receives the GDI functions sent from the application ofthe sharing document, converts each of the GDI functions into a GDIinstruction, and a GDI document is formed by synthesizing GDIinstruction flow composed of all the GDI instructions.

Step 303: an IM client to the document sender compresses and encryptsthe GDI document.

In this step, an IM client to the document sender first compresses thedocument generated by the virtual printer module with such a dictionarycompression algorithm as the LZ77 and the LZW, to make space occupied bythe document smaller, which is favorable for transmission over aNetwork; and then, encrypts the compressed GDI document with such aconventional algorithm which is designated with the document receiver inadvance as a symmetrical encryption algorithm and an asymmetricalencryption algorithm, to improve security of the sharing document.

In addition, in this step, the IM client to the document sender may alsofirst encrypt the GDI document generated by the virtual printer moduleand then compress the encrypted GDI document.

Step 304: the document sender sends the compressed and encrypted GDIdocument to the document receiver.

In this step, when transmitting the sharing document using an IM tool,the document sender sends the compressed and encrypted GDI document tothe document receiver based on Steps 102 to 108 or Steps 202 to 203described in the background of the invention. In the case that thedocument sender is transmitted in a LAN, the document sender logs on acomputer to the document receiver and copies the compressed andencrypted GDI document into a document folder in the computer. In thecase that the document sender is transmitted through an e-mail, thedocument sender sends the compressed and encrypted GDI document as anattachment to the document receiver.

Step 305: an IM client to the document receiver decompresses anddecrypts the received GDI document.

If the compression is first performed and then the encryption isperformed in Step 303, in this step, the IM client to the documentreceiver first decrypts the GDI document sent from the document senderbased on the encryption and decryption algorithm designated in advance,and then, decompresses the decrypted GDI document.

If the encryption is first performed and then the compression isperformed in Step 303, in this step, the IM client to the documentreceiver first decompresses the GDI document sent from the documentsender, and then, decrypts the decompressed GDI document based on theencryption and decryption algorithm designated in advance.

Step 306: the IM client to the document receiver restores the decryptedand decompressed GDI document as to make the contents of the GDIdocument consistent with the sharing document. Here, the restorationoperation corresponds to the conversion operation in Step 302, i.e. therestoration operation is the counter process of the conversionoperation, it also can be called the decode operation of the GDIdocument.

In this step, the IM client, computer in the LAN, or e-mail client tothe document receiver extracts a GDI instruction flow from the GDIdocument, finds the corresponding GDI function based on the number ofGDI function contained in each of the GDI instructions, and performseach GDI function orderly to restore the GDI document into suchrepresenting forms as characters and pictures, which are the same asthose of the sharing document in the document sender.

Step 307: the document receiver checks and views the received document.

In this step, the document receiver directly opens the restored GDIdocument, checks and views the GDI document. Thus, the objective ofsharing the same document with the document sender is attained withoutassistance of any application.

What is described above is the general method for transmitting a sharingdocument over a network of the present invention and the key steps ofthe method are hereinafter described in detail.

FIG. 4 is a flow chart of method for generating a GDI document accordingto the embodiment described in FIG. 3. As shown in FIG. 4, the methodfor converting the sharing document into the GDI document in Step 302includes the following steps.

Step 401: the application starts executing the virtual printing of thesharing document.

In this step, first, the document sender opens the sharing document withthe application associated with the sharing document, and then, theapplication starts the virtual printing of the sharing document byopening the interface for interacting with the virtual printer module.

Step 402: the application determines whether the virtual printing shouldbe terminated, and performs Step 407 if yes; otherwise, performs Step403.

In this step, the application determines, based on determining whetherits GDI functions have all been sent to the virtual printer module,whether the print should be terminated, and specifically, theapplication deems that the virtual printing should be terminated if theGDI functions have all been sent to the virtual printer module, and theapplication deems that the virtual printing should not be terminated ifall of the GDI functions have not been sent.

Step 403: the application sends a GDI function to the virtual printermodule by calling a print driver GDI transfer interface function.

For the application, a document with rich pictures and characters is thedisplay result obtained by calling a series of GDI functions performedorderly by the GDI subsystem. The virtual printing process of a documentis the same as that for the application displaying the document, thatis, the virtual printing output of the document is also implemented byperforming a series of GDI functions. There are two special GDIfunctions in the virtual printing process: a StartDoc function and anEndDoc function. The function of the StartDoc function is that theapplication notifies the print driver to start the print of a newdocument while the function of the EndDoc function is to notify theprint driver to terminate the print of a document. In this step, theapplication sends the leading one of the GDI functions that have notbeen sent out to the virtual printer module. The GDI function includesthe name of the GDI function and the detailed information, such as anumber of the parameters of the function and detailed value of each ofthe parameters.

Step 404: the virtual printer module converts the received GDI functioninto the GDI instruction and returns the result of the conversion to theapplication.

In the present invention, a GDI instruction includes the followingportions at least:

1. number of GDI function: occupying 4 bytes, each of the GDI functionshaving a number of GDI function corresponding to its name uniquely;

2. serial number of the GDI performance: occupying 4 bytes andindicating the implementing order of the GDI function for the sharingdocument, the smaller the serial number of the GDI performance being,the earlier the function being performed;

The GDI instruction further comprises:

3. total length of the GDI instruction: occupying 4 bytes and indicatingthe total length of each portion in the GDI instruction;

4. number of the parameters: occupying 1 byte and indicating a number ofthe parameters contained in the GDI function.

Moreover, if the GDI function contains n parameters, the GDI instructionalso includes the lengths of the first parameter, the second parameter,. . . , and the n^(th) parameter, each of which occupies 4 bytes, andvalue of each parameter.

For example, for the GDI function, _LineTo(int x, int y), a number ofGDI that the GDI function corresponding to is 54, value of the firstparameter of the GDI function, x, is 199, and value of the secondparameter is 218. According to the above description of GDI function,the GDI function is converted into the format shown in Table 1.

TABLE 1 Number of GDI 54 the serial number of the GDI performance 5Total length of the GDI instruction: 29 Number of the parameters: 2Length of the first parameter 4 Value of the first parameter 199 Lengthof the second parameter 4 Value of the second parameter 218

In this step, the virtual printer module converts the received GDIfunction based on the format of GDI instruction shown in Table 1, andreturns the implementing result of GDI function indicating whether theconversion is successful to the application. The detailed process ofthis step will be hereinafter described in detail.

Steps 405˜407: the application determines, based on the implementingresult of GDI function returned by the virtual printer module, whetherthe conversion is successful, and if yes, starts to deal with the nextGDI function and returns back to Step 402; otherwise, the applicationterminates the virtual printing of the sharing document by sending theEndDoc function to the virtual printer module, and the virtual printermodule terminates the procedure for generating the GDI document afterreceiving the EndDoc function.

The application keeps on sending a next GDI function to the virtualprinter module if the virtual printer module has returned animplementing result indicating that the GDI function has been performedsuccessfully; otherwise, that is, if the application has received animplementing result indicating a failure in performing the GDI function,the application stops sending a GDI function to the virtual printermodule and terminates the virtual printing of the sharing document bysending an EndDoc function.

Thus, the sharing document is converted into the GDI document byperforming the virtual printing.

The process for converting a GDI function into the GDI instruction inStep 404 is hereinafter described in detail. FIG. 5 shows the flow chartof the method for generating a GDI instruction stream according toembodiment of FIG. 4. As shown in FIG. 5, the virtual printing convertsa received GDI function into the GDI instruction and returns the resultof the conversion as the implementing result of the GDI function to theapplication. The method includes the following steps:

Step 501: the print driver GDI transfer interface function is called bythe application.

Since the application calls the printer driver GDI transfer interfacefunction, in this step, the interface function starts to be performed inthe virtual printer module so as to start to convert the GDI functionsent from the application.

Step 502: the virtual printer module determines whether the received GDIfunction is the StartDoc function indicating start of virtual printing,and performs Step 503 if yes; otherwise, performs Step 506.

Since the function of the StartDoc function is to notify the virtualprinter module to start to print a new document, that is, the StartDocfunction is the first GDI function that is sent to the virtual printermodule by the application when the application performs the transfer forprinting, the objective of the determination performed in this step isto determine whether the conversion of the sharing document into the GDIdocument is to be started, and thus, the subsequent steps may bedetermined.

Steps 503˜505: the virtual printer module acquires the correspondingtable of the names and the numbers of GDI functions from the GDIsubsystem, initializes the variable of the serial number of the GDIperformance to 0, and establishes and opens an empty GDI document.

What has been performed above is the initialization operation in theprocess for converting the sharing document into the GDI document.

For a GDI subsystem, the GDI subsystem contains a corresponding table inwhich each of the names of GDI functions corresponds to a number of GDIfunction uniquely. The name of GDI function is valid only when thecorresponding number of GDI function can be found in the correspondingtable, and likewise, the number of GDI function is valid only when thecorresponding name of GDI function can be found. Thus, the correspondingtable is acquired to determine whether a name of GDI function sent fromthe application is valid in the subsequent procedure.

Since the application sends the corresponding GDI functions based on thecontents of the sharing document, a variable of the serial number of GDIperformance is set here so as to the document receiver which receivesthe sharing document knows definitely the performing order of each ofthe GDI instructions. Thus, the contents of the sharing document may bereproduced. In the case that the received name of GDI function is valid,the current variable of the serial number of GDI performance is written,as the serial number of GDI performance, into the GDI instruction toindicate the performing order of the GDI instruction in all the GDIinstructions contained in the sharing document. The GDI instruction witha smaller variable of the serial number of GDI performance is performedearlier.

After acquiring the corresponding table and initializing the variable ofthe serial number of GDI performance, the virtual printer moduleestablishes and opens an empty GDI document by calling a function foropening a document, such as the Open File function, and thus, thevirtual printer module may write the converted GDI instruction flow intothe GDI document.

Thus, the virtual printer module completes the initialization andgenerates a initialization variable indicating that the initializationhas be completed, for example, in the case that the initializationvariable equals 1, it is indicated that the initialization has beencompleted.

Step 506: the virtual printer module determines whether theinitialization has been completed and performs Step 507 if yes;otherwise, cycles back to Step 503;

In this step, the virtual printer module determines the steps to beperformed subsequently by determining whether the value of theinitialization variable indicates that the initialization has beencompleted.

Step 507˜508: the virtual printer module determines whether the receivedGDI function is the EndDoc function indicating termination of virtualprinting, and closes the GDI document and performs Step 513 if yes;otherwise, performs Step 509.

Since the EndDoc function is a function that is used by the GDIsubsystem to notify the virtual printer module to terminate the virtualprinting of a document, the virtual printer module stops converting aGDI function into the GDI instruction and closes the GDI document bycalling the Close File function.

Steps 509˜510: the virtual printer module determines whether the numberof GDI function corresponding to the current GDI function has beenfound, and adds 1 to the variable of the serial number of GDIperformance; otherwise, performs Step 513.

If there is a number of GDI function corresponding to the name of GDIfunction received currently from the application, the name of GDIfunction is valid, that is, a portion of the contents of the sharingdocument may be restored by performing the GDI function corresponding tothe name of GDI function. In the case that the current name of GDIfunction is valid, the virtual printer module adds 1 to the variable ofthe serial number of GDI performance. Since in the present invention,the serial number of GDI performance with the value of 1 indicates thefirst GDI instruction to be performed, 1 is added to the value of thevariable of the serial number of GDI performance in this step. Ofcourse, if the serial number of GDI performance with the value of 0indicates the first GDI instruction to be performed, 1 needs not to beadded to the variable of the serial number of GDI performance in thisstep while 1 should be added after the GDI function is converted intothe GDI instruction.

Step 511˜512: the virtual printer module generates a GDI instruction byencoding the variable of the serial number of GDI performance and theGDI function based on the format of GDI instruction stream, and writesthe GDI instruction into the GDI document.

In this step, the virtual printer module writes the contents of thecurrent GDI function into the corresponding parts of the table based onthe format of GDI instruction shown in Table 1. The variable of theserial number of GDI performance is used as the serial number of GDIperformance in Table 1, the number corresponding to the name of currentGDI function found in Step 509 is used as the number of GDI function,and all the other parts are contained in the GDI function received fromthe application. Thus, a GDI function is converted into the GDIinstruction.

Next, the virtual printer module writes the acquired GDI instructioninto the GDI document established and opened in Step 505.

Step 513: the virtual printer module returns the implementing result tothe application.

In this step, the virtual printer module takes the implementing result,which indicates whether the conversion of the current GDI function tothe GDI instruction is successful, as the implementing result of the GDIfunction and returns it to the application, and thus, the applicationmay decide to keep on sending a GDI function or not.

If this step is performed after Step 508, a implementing resultindicating that the GDI document has been generated is returned to theapplication; If this step is performed after Step 509, a implementingresult indicating a failure in converting GDI function is returned tothe application; If this step is performed after Step 512, aimplementing result indicating that a GDI function is convertedsuccessfully is returned to the application;

Thus, the virtual printer module converts a GDI function into a GDIinstruction by performing the printer driver GDI transfer interfacefunction.

The same contents as those of the sharing document may be displayed onlyafter restoring the GDI document composed of the GDI instructions. FIG.6 is a flow chart of method for restoring the received GDI documentaccording to embodiment of FIG. 3. As shown in FIG. 6, the method forrestoring a GDI document in Step 306 includes the following steps:

Step 601: the network terminal to the document receiver applies to itsGDI subsystem for a graph Device Context (DC).

A graph DC, which is a graph handle allocated by the GDI subsystem,provides a virtual space for restoring the GDI document, and thus, eachof the GDI instructions in the GDI document may be performed orderly inthe graph DC.

Step 602˜603: the network terminal to the document receiver reads allthe GDI instructions in the GDI document and sorts all the GDIinstructions ascending based on the serial number of GDI performance inthe GDI instructions.

The network terminal to the document receiver first reads all the GDIinstructions from the GDI document, then extracts the serial number ofGDI performance from the GDI instructions, and sorts the correspondingGDI instructions in the order of the values of the serial number of GDIperformance being from small to large. Thus, each of the GDIinstructions may be performed in the sorted order in the subsequentsteps to restore the contents of the sharing document.

Step 604: the network terminal to the document receiver initializes thevariable of the serial number of GDI performance to the minimum of theserial numbers of GDI performance.

For the IM client, computer in the LAN or e-mail client to the documentreceiver, the variable of the serial number of GDI performance is theindex to perform a GDI instruction, and specifically, the serial numberof GDI performance in the GDI instruction being performed is the same asthe current value of the variable of the serial number of GDIperformance. In this step, the variable of the serial number of GDIperformance is initialized to the minimum variable of the serial numbersof GDI performance so as to start to perform the GDI instructions fromthe GDI instruction with the minimum serial number of GDI performance.

Step 605: the network terminal to the document receiver determineswhether the GDI instruction corresponding to the variable of the serialnumber of GDI performance is found, and performs Step 606 if yes;otherwise, performs Step 609.

Steps 606˜608: the network terminal to the document receiver acquiresthe number of GDI function in the GDI instruction and the GDI functioncorresponding to the number of GDI function, performs the GDI functionin the graph DC acquired through application, adds 1 to the variable ofthe serial number of GDI performance, and cycles back to Step 605.

The network terminal to the document receiver extracts the number of GDIfunction from the current GDI performance, searches out thecorresponding name of GDI function in the corresponding table of thenames and numbers of GDI functions, performs the GDI function to restorea portion of the contents of the sharing document; and then, the networkterminal adds 1 to the serial number of GDI performance so as to findthe next GDI instruction to be performed.

Step 609˜610: the network terminal to the document receiver determineswhether there is a GDI instruction with the serial number of GDIinstruction larger than the variable of the serial number of GDIperformance, and cycles back to Step 608 if yes; otherwise, closes theGDI document and terminating the procedure for restoring the GDIdocument.

In this step, the function of determining whether there is a GDIinstruction with the serial number of GDI performance larger than thevariable of the serial number of GDI performance is to determine whetherthere is a GDI instruction that has not been performed.

Thus, the network terminal to the document receiver, such as an IMclient, a computer in the LAN or an e-mail client, completes therestoring of the GDI document sent from the document sender, and afterthis, the document receiver may view the contents exactly same as thoseof the sharing document of the document sender.

Based on the above methods of the present invention, the presentinvention also provides a system for transmitting a document over aNetwork, and besides the existing document sender and document receiver,the system further includes: a virtual printer module and a restorationmodule. The virtual printer module may convert a sharing document of thedocument sender into a GDI document, while the restoration module mayperform restoration of a GDI document so as to acquire the same contentsas those of the sharing document of the document sender.

FIG. 7 is a schematic diagram illustrating the composition structure ofa preferred embodiment of the system of the present invention. As shownin FIG. 7, the system includes a document sender, a document receiver, avirtual printer module and a restoration module.

The document sender is used for outputting the sharing document to besent to the virtual printer module, receiving the GDI document acquiredthrough conversion of the sharing document from the virtual printermodule and sending the GDI document to the document receiver; thevirtual printer module is used for receiving a sharing document from thedocument sender, performing virtual printing to convert the sharingdocument into the GDI document, and outputting the GDI document to thedocument sender; the restoration module is used for receiving a GDIdocument from the document sender, performing a restoration operation ofthe GDI document to restore the same contents as those of the sharingdocument of the document sender from the GDI document, and outputtingthe contents to the document receiver; the document receiver is used forreceiving a GDI document from the document sender, outputting the GDIdocument to the restoration module, and receiving the same contents asthose of the sharing document of the document sender from therestoration module so as to provide the contents to a user of thereceiver for looking over.

In order that the functions of compressing and decompressing a documentare achieved to save the transportation resources of system, the systemof the present invention may further include: the compression module andthe decompression module shown with dash dotted lines in FIG. 7. Thecompression module is used for receiving a GDI document from thedocument sender, compressing the GDI document, and outputting thecompressed GDI document to the document sender; the decompression moduleis used for receiving a compressed GDI document from the documentreceiver, decompressing the GDI document, and outputting thedecompressed GDI document to the document receiver. In this case, afterreceiving a GDI document from the virtual printer module, the documentsender needs to send the GDI document to the compression module, receivethe compressed GDI document from the compression module, and send thecompressed GDI document to the document receiver; meanwhile, thedocument receiver needs to send the received compressed GDI document tothe decompression module, receive the decompressed GDI document from thedecompression module, and output the decompressed GDI document to therestoration module to be dealt with.

In order that the functions of encrypting and decrypting a document areimplemented to improve the transportation security of the system, thesystem of the present invention may further include: the encryptionmodule and the decryption module shown with dotted lines in FIG. 7. Theencryption module is used for receiving a GDI document from the documentsender, encrypting the GDI document, and outputting the encrypted GDIdocument to the document sender; the decryption module is used forreceiving an encrypted GDI document from the document receiver,decrypting the encrypted GDI document, and outputting the decrypted GDIdocument to the document receiver. In this case, after acquiring a GDIdocument from the virtual printer module, the document sender needs tosend the GDI document to the encryption module, receive the encryptedGDI document from the encryption module, and send the encrypted GDIdocument to the document receiver; meanwhile, the document receiverneeds to send the received encrypted GDI document to the decryptionmodule, receive the decrypted GDI document from the decryption module,and output the decrypted GDI document to the restoration module to bedealt with.

Moreover, the functions of encryption/decryption andcompression/decompression may be implemented in the system at the sametime and in such a case, the system of the present invention needs toinclude the encryption module/decryption module and the compressionmodule/decompression module at the same time. Since the order of theencryption/decryption processing and the compression/decompressionprocessing is not limited in the present invention, the document sendermay first send a GDI document sent from the virtual printer module tothe encryption module to be dealt with and then send the encrypted GDIdocument sent from the encryption module to the compression module to bedealt with; or the document sender may first send a GDI document sentfrom the virtual printer module to the compression module to be dealtwith and then send the compressed GDI document sent from the compressionmodule to the encryption module to be dealt with. Accordingly, thedocument receiver may first send an encrypted and compressed GDIdocument sent from the document sender to the decompression module to bedealt with and then send the decompressed GDI document sent from thedecompression module to the decryption module to be dealt with; or thedocument receiver may first send an encrypted and compressed GDIdocument sent from document sender to the decryption module to be dealtwith and then send the decrypted GDI document sent from the decryptionmodule to the decompression module to be dealt with.

In the system of the present invention, the virtual printer module, thecompression module, the encryption module are all connected to thedocument sender and may be entities set independently or integrated intothe document sender; accordingly, the restoration module, thedecompression module and the decryption module are all connected to thedocument receiver and may be entities set independently or integratedinto the document receiver.

In the embodiment of the present invention, the document sender and thedocument receiver may be two IM users using an IM tool, respectively,may be two computer users in the LAN, respectively, or may be two usersusing e-mail, respectively.

With the method for transmitting a sharing document over a Network ofthe embodiment of the present invention, the receiver of the document isenabled to view the contents of the sharing document successfully, whichis not limited by the applications.

The foregoing description is only preferred embodiments of the presentinvention and is not for use in limiting the protection scope thereof.All the modifications, equivalent replacements or improvements in thescope of the present invention's sprit and principles shall be includedin the protection scope of the present invention.

The invention claimed is:
 1. A method for transmitting a sharingdocument containing only text and pictures over a network, comprisingthe steps of: converting, by a virtual printer module in a first clientdevice, GDI (Graph Device Interface) functions corresponding to asharing document to be transmitted into GDI instructions, forming a GDIdocument by synthesizing the GDI instructions, and sending the GDIdocument to a document sender in the first client device; receiving, bya document receiver in a second client device, the GDI document sentfrom the document sender through a network; and restoring, by thedocument receiver, the received GDI document, and contents of therestored GDI document being the same as that of the sharing document;the method for said converting the GDI functions corresponding to thesharing document into GDI instruction, wherein forming the GDI documentby synthesizing the GDI instructions comprises the steps of: opening, byan application of the sharing document on the document sender, theinterface for interacting with the virtual printer module and startingto perform virtual printing of the sharing document; determining, by theapplication of the sharing document, whether the virtual printing shouldbe terminated, if the virtual printing should be terminated, terminatingthe virtual printing of the sharing document by sending a GDI functionindicating the end of the sharing document to the virtual printer moduleand terminating current procedure for generating the GDI document; ifthe virtual printing should not be terminated, sending, by theapplication of the sharing document, based on the contents of thesharing document and by calling print driver GDI transfer interfacefunction, a GDI function to the virtual printer module, and converting,by the virtual printer module, the received GDI function into a GDIinstruction and returning the result of the conversion to theapplication of the sharing document; and determining, by the applicationof the sharing document, based on the result of the conversion returnedby the virtual printer module, whether the conversion is successful, andif the conversion is successful, starting, by the application of thesharing document, to deal with the next GDI function and cycling back tothe step of determining whether the virtual print should be terminated;if the conversion is unsuccessful, terminating, by the application ofthe sharing document, the virtual printing of the sharing document bysending a GDI function indicating the end of the sharing document to thevirtual printer module and terminating the procedure for generating theGDI document; the GDI instruction comprises at least: the name of GDIfunction, number of GDI function and serial number of GDI performance;the method for converting, by the virtual printer module, the receivedGDI function into the GDI instruction and retuning the result of theconversion to the application of the sharing document, comprising thesteps of: calling, by the application of sharing document, the printdriver GDI transfer interface function, determining, by the virtualprinter module, whether the received GDI function is a GDI functionindicating start of virtual printing of the sharing document, if thereceived GDI function is a GDI function indicating start of virtualprinting of the sharing document, acquiring, by the virtual printedmodule, a corresponding table of names and numbers of GDI functions froma GDI subsystem, initializing the variable of the serial number of GDIperformance to 0, establishing and opening an empty GDI document, andgenerating an initialization variable indicating the completionsituation of the initialization; if the received GDI function is notaGDI function indicating start of virtual printing of the sharingdocument, determining, based on the initialization variable, whether theinitialization has been completed, and if the initialization has beencompleted, determining whether the received GDI function is a GDIfunction indicating end of the virtual printing of the sharing document,if the received GDI function is a GDI function indicating end of thevirtual printing of the sharing document, closing the GDI document, andreturning, by the virtual printer module, the result of the conversionto the application of the sharing document; if the received GDI functionis not a GDI function indicating end of the virtual print of the sharingdocument, determining whether the number of GDI function correspondingto the current GDI function is found, and if the number of GDI functioncorresponding to the current GDI function is found, adding 1 to thevariable of the serial number of GDI performance, encoding the name ofGDI function, the variable of the serial number of GDI performance andthe GDI function based on the format of GDI instruction stream so as togenerate GDI instruction, and writing the GDI instruction into the GDIdocument; and if the number of GDI function corresponding to the currentGDI function is not found, returning, by the virtual printer module, theresult of the conversion to the application of the sharing document; andif initialization has not been completed, cycling back to the step ofacquiring, by the virtual printer module, a corresponding table of namesand numbers of GDI functions from a GDI subsystem, initializing thevariable of the serial number of GDI performance to 0, establishing andopening an empty GDI document, and generating an initialization variableindicating the completion situation of the initialization.
 2. The methodof claim 1, further comprising the steps of: compressing, by thedocument sender, the GDI document; and decompressing, by the documentreceiver, the received GDI document.
 3. The method of claim 1, furthercomprising the steps of: encrypting, by the document sender, the GDIdocument; and decrypting, by the document receiver, the received GDIdocument.
 4. The method of claim 1, wherein the method for receiving, bythe document receiver, the GDI document sent from the document sender,through a network comprises at least the steps of: receiving, by thedocument receiver, the GDI document sent from the document sender withan Instant Messaging tool; or, receiving, by the document receiver, theGDI document sent from the document sender through an e-mail; or,receiving, by the document receiver, the GDI document sent from thedocument sender by logging on the network terminal to the documentsender.
 5. A system for transmitting a sharing document containing onlytext and pictures over a network, comprising: a first network computerincluding a processor coupled to a memory storing instructions forexecution by the processor, to convert GDI (Graph Device Interface)functions corresponding to a sharing document to be transmitted into GDIinstructions, form a GDI document by synthesizing the GDI instructions,and send the GDI document to the second network computer over thenetwork; a second network computer including a processor coupled to amemory storing instructions for execution by the processor, to receivethe GDI document from the first network computer, restore the GDIdocument, and contents of the restored GDI document being same as thatof the sharing document; the first network computer comprises a documentsender and a virtual printing module, and an application sharingdocument on the document sender is to: open the interface forinteracting with the virtual printer module and start to perform virtualprinting of the sharing document; determine whether the virtual printingshould be terminated, if the virtual printing should be terminated,terminate the virtual printing of the sharing document by sending a GDIfunction indicating the end of the sharing document to the virtualprinter module and terminate current procedure for generating the GDIdocument; if the virtual printing should not be terminated, send, basedon the contents of the sharing document and b calling print driver GDItransfer interface function, a GDI function to the virtual printermodule; receive a result of converting the received GDI function into aGDI instruction from the virtual printer module; determine, based on theresult received from the virtual printer module, whether the conversionis successful, and if the conversion is successful, start to deal withthe next GDI function and cycle back to the step of determining whetherthe virtual print should be terminated; if the conversion isunsuccessful, terminate the virtual printing of the sharing document bysending a GDI function indicating the end of the sharing document to thevirtual printer module and terminate the procedure for generating theGDI document; and the virtual printer module is to convert the receivedGDI function into a GDI instruction and return the result of theconversion to the application of the sharing document; and the GDIinstruction comprises at least: the name of GDI function, number of GDIfunction and serial number of GDI performance; the virtual module is to:after the application of sharing document calls the print driver GDItransfer interface function, determine, whether the received GDIfunction is a GDI function indicating start of virtual printing of thesharing document, if the received GDI function is a GDI functionindicating start of virtual printing of the sharing document, acquire acorresponding table of names and numbers of GDI functions from a GDIsubsystem, initialize the variable of the serial number of GDIperformance to 0, establish and open an empty GDI document, and generatean initialization variable indicating the completion situation of theinitialization; if the received GDI function is not a GDI functionindicating start of virtual printing of the sharing document, determine,based on the initialization variable, whether the initialization hasbeen completed, and if the initialization has been completed, determinewhether the received GDI function is a GDI function indicating end ofthe virtual printing of the sharing document, if the received GDIfunction is a GDI function indicating end of the virtual printing of thesharing document, close the GDI document, and return the result of theconversion to the application of the sharing document; if the receivedGDI function is not a GDI function indicating end of the virtual printof the sharing document, determine whether the number of GDI functioncorresponding to the current GDI function is found, and if the number ofGDI function corresponding to the current GDI function is found, add 1to the variable of the serial number of GDI performance, encode the nameof GDI function, the variable of the serial number of GDI performanceand the GDI function based on the format of GDI instruction stream so asto venerate a GDI instruction, and write the GDI instruction into theGDI document; and if the number of GDS function correspond to thecurrent GDI function is not found, return the result of the conversionto the application of the sharing document; and if initialization hasnot been completed, cycle back to the step of acquiring thecorresponding table of names and numbers of GDI functions from the GDIsubsystem, initializing the variable of the serial number of GDIperformance to 0, establishing and opening the empty GDI document, andgenerating the initialization variable indicating the completionsituation of the initialization.
 6. The system of claim 5, wherein thefirst network computer is further to compress the GDI document, andoutputting the compressed GDI document to the second network computer;the second network computer is further to receive the compressed GDIdocument sent from the first network computer and decompress the GDIdocument.
 7. The system of claim 5, wherein the first network computeris further to encrypt the GDI document and send the encrypted GDIdocument to the second network computer; the second network computer isfurther to receive the encrypted GDI document sent from the firstnetwork computer and decrypt the encrypted GDI document.
 8. A networkcomputer for transmitting a sharing document containing only text andpictures to another network computer over a network, including aprocessor coupled to a memory storing instructions for execution by theprocessor, and comprising a document sender and a virtual printermodule; the virtual printer module being stored on a memory; thedocument sender is to output a sharing document containing only text andpictures to be sent to the virtual printer module, receive a GDIdocument into which the sharing document is converted from the virtualprinter module and send the GDI document to the another network computerover the network; and the virtual printer module is to receive thesharing document from the document sender, convert GDI functionscorresponding to the sharing document into GDI instructions, form a GDIdocument by synthesizing the GDI instructions, and output the GDIdocument to the document sender; an application of the sharing documenton the document sender is to open the interface for interacting with thevirtual printer module and start to perform virtual printing of thesharing document; determine whether the virtual printing should beterminated, if the virtual printing should be terminated, terminate tovirtual printing of the sharing document by sending a GDI functionindicating the end of the sharing document to the virtual printer moduleand terminate current procedure for generating the GDI document; if thevirtual printing should not be terminated, send, based on the contentsof the sharing document and by calling print driver GDI transferinterface function, a GDI function to the virtual printer module;receive a result of converting the received GDI function into a GDIinstruction from the virtual printer module; determine, based on theresult received from the virtual printer module, whether the conversionis successful, and if the conversion is successful, start to deal withthe next GDI function and cycle back to the step of determining whetherthe virtual print should be terminated; if the conversion isunsuccessful, terminate the virtual printing of the sharing document bysending a GDI function indicating the end of the sharing document to thevirtual printer module and terminate the procedure for generating theGDI document; and the virtual printer module is to convert the receivedGDI function into a GDI instruction and return the result of theconversion to the application of the sharing document; and the GDIinstruction comprises at least: the name of GDI function, number of GDIfunction and serial number of GDI performance; the virtual printermodule is to: after the application of sharing document calls the printdriver GDI transfer interface function, determine, whether the receivedGDI function is a GDI function indicating start of virtual printing ofthe sharing document, if the received GDI function is a GDI functionindicating start of virtual printing of the sharing document, acquire acorresponding table of names and numbers of GDI functions from a GDIsubsystem, initialize the variable of the serial number of GDIperformance to 0, establish and open an empty GDI document, and generatean initialization variable indicating the completion situation of theinitialization; if the received GDI function is not a GDI functionindicating start of virtual printing of the sharing document, determine,based on the initialization variable, whether the initialization hasbeen completed, and if the initialization has been completed, determinewhether the received GDI function is a GDI function indicating end ofthe virtual printing of the sharing document, if the received GDIfunction is a GDI function indicating end of the virtual printing of thesharing document, close the GDI document, and return the result of theconversion to the application of the sharing document; if the receivedGDI function is not a GDI function indicating end of the virtual printof the sharing document, determine whether the number of GDI functioncorresponding to the current GDI function is found, and if the number ofGDI function corresponding to the current GDI function is found, add 1to the variable of the serial number of GDI performance, encode the nameof GDI function, the variable of the serial number of GDI performanceand the GDI function based on the format of GDI instruction stream so asto generate a GDI instruction, and write the GDI instruction into theGDI document; and if the number of GDI function corresponding to thecurrent GDI function is not found, return the result of the conversionto the application of the sharing document; and if initialization hasnot been completed, cycle back to the step of acquiring thecorresponding table of names and numbers of GDI functions from the GDIsubsystem, initializing the variable of the serial number of GDIperformance to 0, establishing and opening the empty GDI document, andgenerating the initialization variable indicating the completionsituation of the initialization.
 9. The network computer of claim 8,further comprising: a compression module stored on the memory; thecompression module is to receive a GDI document from the documentsender, compress the GDI document, and output the compressed GDIdocument to the document sender; and the document sender is further tooutput a GDI document sent from the virtual printer module to thecompression module and send the compressed GDI document sent from thecompression module to a document receiver.
 10. The network computer ofclaim 9, further comprising: an encryption module stored on the memory;the encryption module is to receive a GDI document from a documentsender, encrypt the GDI document, and output the encrypted GDI documentto the document sender; and the document sender is further to output aGDI document sent from the virtual printer module to the encryptionmodule and send the encrypted GDI document sent from the encryptionmodule to a document receiver.
 11. The network computer of claim 10,wherein the compression module is an entity set independently orintegrated into the document sender, the encryption module is an entityset independently or integrated into the document sender, and thevirtual printer module is an entity set independently or integrated intothe document sender.
 12. A method for sending a sharing documentcontaining only text and pictures over a network, comprising the stepsof: converting, by a virtual printer module in a first client device,GDI (Graph Device Interface) functions corresponding to a sharingdocument to be transmitted into GDI instructions, forming a GDI documentby synthesizing the GDI instructions, and sending the GDI document to adocument sender in the first client device; and sending, by the documentsender, the GDI document to a document receiver in a second clientdevice through a network: the method for said converting the GDIfunctions corresponding to the sharing document into GDI instruction,forming the GDI document by synthesizing the GDI instructions comprisesthe steps of: opening, by an application of the sharing document on thedocument sender, the interface for interacting with the virtual printermodule and starting to perform virtual printing of the sharing document;determining, by the application of sharing document, whether the virtualprinting should be terminated, if the virtual printing should beterminated, terminating the virtual printing of the sharing document bysending a GDI function indicating the end of the sharing document to thevirtual printer module and terminating current procedure for generatingthe GDI document; if the virtual printing should not be terminated,sending, by the application of the sharing document, based on thecontents of the sharing document and by calling print driver GDItransfer interface function, a GDI function to the virtual printermodule, and converting, by the virtual printer module, the received GDIfunction into a GDI instruction and returning the result of theconversion to the application of the sharing document; and determining,by the application of the sharing document, based on the result of theconversion returned by the virtual printer module, whether theconversion is successful, and if the conversion is successful, starting,by the application of the sharing document, to deal with the next GDIfunction and cycling back to the step of determining whether the virtualprint should be terminated; if the conversion is unsuccessful,terminating, by the application of the sharing document, the virtualprinting of the sharing document by sending a GDI function indicatingthe end of the sharing document to the virtual printer module andterrninating the procedure for generating the GDI document, the GDIinstruction comprises at least: the name of GDI function, number of GDIfunction and serial number of GDI performance: the method forconverting, by the virtual printer module, the received GDI functioninto the GDI instruction and returning the result of the conversion tothe application of the sharing document, comprising the steps of:calling, by the application of sharing document, the print driver GDItransfer interface function, determining, by the virtual printer module,whether the received GDI function is a GDI function indicating start ofvirtual printing of the sharing document, if the received a GDI functionis a GDI function indicating start of virtual printing the sharingdocument, acquiring, by the virtual printer module, a correspondingtable of names and numbers of GDI functions from a GDI subsystem,initializing the variable of the serial number of GDI performance to 0,establishing and opening an empty GDI document, and generating aninitialization variable indicating the completion situation of theinitialization; if the received GDI function is not a GDI functionindicating start of virtual printing of the sharing document,determining, based on the initialization variable, whether theinitialization has been completed, and if the initialization has beencompleted, determining whether the received GDI function is a GDIfunction indicating end of the virtual printing of the sharing document,if the received GDI function is a GDI function indicating end of thevirtual printing of the sharing document, closing the GDI document, andreturning, by the virtual printer module, the result of the conversionto the application of the sharing document; if the received GDI functionis not a GDI function indicating end of the virtual print of the sharingdocument, determining whether the number of GDI function correspondingto the current GDI function is found, and if the number of GDI functioncorresponding to the current GDI function is found, adding 1 to thevariable of the serial number of GDI performance, encoding the name ofGDI function, the variable of the serial number of GDI performance andthe GDI function based on the format of GDI instruction stream so as togenerate a GDI instruction, and writing the GDI instruction into the GDIdocument; and if the number of GDI function corresponding to the currentGDI function is not found, returning, by the virtual printer module, theresults of the conversion to the application of the sharing document;and if initialization has not been completed, cycling back to the stepof acquiring, by the virtual printer module, a corresponding table ofnames and numbers of GDI functions from a GDI subsystem, initializingthe variable of the serial number of GDI performance to 0, establishingand opening an empty GDI document, and generating an initializationvariable indicating the completion situation of the initialization. 13.The method of claim 12, further comprising compressing, by the documentsender, the GDI document.
 14. The method of claim 12, further comprisingencrypting, by the document sender, the GDI document.
 15. The method ofclaim 12, wherein the method for said determining whether the virtualprinting should be terminated comprises the steps of determining, by theapplication of the sharing document, whether the GDI functions calledbased on the contents of the sharing document have all been sent to thevirtual printer module, and if the GDI functions called based on thecontents of the sharing document have all been sent to the virtualprinter module, determining that the virtual printing should beterminated, and if the GDI functions called based on the contents of thesharing document have not all been sent to the virtual printer module,determining that the virtual printing should not be terminated.
 16. Themethod of claim 12, wherein the GDI instruction comprises at least thetotal length of current GDI interface instruction, number of parameters,parameter value of each of parameters and length of parameter value. 17.The method of claim 12, the method for sending, by the document sender,the GDI document to a document receiver through a network comprising thesteps of: sending, by the document sender, the GDI document to adocument receiver with an Instant Messaging tool; or, sending, by thedocument sender, the GDI document to a document receiver through ane-mail; or, sending, by the document sender, the GDI document to adocument receiver by logging on the network terminal to the documentreceiver.
 18. A method for receiving a sharing document containing onlytext and pictures of format over a network, comprising the steps of:receiving, by a document receiver in a second client device, a GDI(Graph Device Interface) document sent from a document sender in a firstclient device through a network, the GDI document being formed bysynthesizing GDI instructions into which GDI functions corresponding toa sharing document to be transmitted is converted by a virtual printermodule in the first client device; and restoring, by the documentreceiver, the received GDI document, contents of the restored GDIdocument being same as that of the sharing document; the method forconverting the GDI functions corresponding to the sharing document intoGDI instructions, forming the GDI document by synthesizing the GDIinstructions comprises the steps of: opening, by an application of thesharing document on the document sender, the interface, for interactingwith the virtual printer module and starting to perform virtual printingof the sharing document; determining, by the application of the sharingdocument, whether the virtual printing should be terminated, if thevirtual printing should be terminated, terminating the virtual printingof the sharing document by sending a GDI function indicating the end ofthe sharing document to the virtual printer module and terminatingcurrent procedure for generating the GDI document; if the virtualprinting should not to be terminated, sending, by the application of thesharing document, based on the contents of the sharing document and bycalling print driver GDI transfer interface function, a GDI function tothe virtual printer module, and converting, by the virtual printermodule, the received GDIfunction into a GDI instruction and returningthe result of the conversion to the application of the sharing document;and determining, by the application of the sharing document, based onthe result of the conversion returned by the virtual printer module,whether the conversion is successful, and if the conversion issuccessful, starting, by the application of the sharing document, todeal with the next GDI function and cycling back to the step ofdetermining whether the virtual print should be terminated; if theconversion is unsuccessful, terminating, by the application of thesharing document, the virtual printing of the sharing document bysending a GDI function indicating the end of the sharing document to thevirtual printer module and terminating the procedure for generating theGDI document; the GDI instruction comprises at least: the name of GDIfunction, number of GDI function and serial number of GDI performance;the method for converting, by the virtual printer module, the receivedGDI function into the GDI instruction and returning the result of theconversion to the application of the sharing document, comprising thesteps of: calling, by the application of sharing document, the printdriver GDI transfer interface function, determining, by the virtualprinter, module whether the received GDI function is a GDI functionindicating start of virtual printing of the sharing document, if thereceived GDI function is a GDI function indicating start of virtualprinting of the sharing document, acquiring, by the virtual printermodule, a corresponding table of names and numbers of GDI functions froma GDI subsystem, initializing the variable of the serial number of GDIperformance to 0, establishing and opening an empty GDI document, andgenerating an initialization variable indicating the completionsituation of the initialization; if the received GDI function is notaGDI function indicating start of virtual printing of the sharingdocument, determining, based on the initialization variable, whether theinitialization has been completed and if the initialization has beencompleted, determining whether the received GDI function is a GDIfunction indicating end of the virtual printing of the sharing document,if the received GDI function is a GDI function indicating end of thevirtual printing of the sharing document, closing the GDI document, andreturning, by the virtual printer module, the result of the conversionto the application of the sharing document; if the received GDI functionis not a GDI function indicating end of the virtual print of the sharingdocument, determining whether the number of GDI function correspondingto the current GDI function is found, and if the number of GDI functioncorresponding to the current GDI function is found, adding 1 to thevariable of the serial number of GDI performance, encoding the name ofGDI function, the variable of the serial number of GDI performance andthe GDI function based on the format of GDI instruction stream so as togenerate GDI instruction, and writing the GDI instruction into the GDIdocument; and if the number of GDI function corresponding to the currentGDI function is not found, returning, by the virtual printer module, theresult of the conversion to the application of the sharing document; andif initialization has not been completed, cycling back to the step ofacquiring, by the virtual printer module, a corresponding table of namesand numbers of GDI functions from a GDI subsystem, initializing thevariable of the serial number of GDI performance to 0, establishing andempty GDI document, and generating an initialization variable indicatingthe completion situation of the initialization.
 19. The method of claim18, further comprising: decompressing, by the document receiver, thereceived GDI document.
 20. The method of claim 18, further comprising:decrypting, by the document receiver, the received GDI document
 21. Themethod of claim 18, the GDI document comprises at least a GDIinstruction; wherein restoring the received GDI document comprises thesteps of performing a graph device function corresponding to the GDIinstruction in the GDI document.
 22. The method of claim 21, the methodfor restoring the received GDI document comprising the steps of:applying, by the network terminal to the document receiver, to its graphdevice subsystem for a Graph Device Context, reading all the GDIinstructions in the received GDI document, sorting all the GDIinstructions ascending based on the serial numbers of GDI performance inthe GDI instructions, and initializing the variable of the serial numberof GDI performance to the minimum of the serial numbers of GDIperformance; determining whether the GDI instruction corresponding tothe variable of the serial number of GDI performance is found, if theGDI instruction is found, acquiring the number of the GDI function inthe current GDI instruction and the GDI function corresponding to thenumber of the GDI function, performing the GDI function in the GraphDevice Context acquired through the application, adding 1 to thevariable of the serial number of GDI performance, and cycling back tothe step of determining whether the GDI instruction corresponding to thevariable of the serial number of GDI performance is found; and if theGDI instruction is not found, determining whether there is a GDIinstruction with the serial number of the GDI performance larger thanthe variable of the serial number of GDI performance, and if there is aGDI instruction with the serial number of the GDI performance largerthan the variable of the serial number of GDI performance, adding 1 tothe variable of the serial number of GDI performance and cycling back tothe step of determining whether the GDI instruction corresponding to thevariable of the serial number of GDI performance is found; if there isno GDI instruction with the serial number of the GDI performance largerthan the variable of the serial number of GDI performance, closing theGDI document and terminating the procedure for restoring the GDIdocument.
 23. The method of claim 18, the method for receiving, by thedocument receiver, a GDI document sent from a document sender through anetwork comprising the steps of: receiving, by the document receiver,the GDI document sent from a document sender with an Instant Messagingtool; or, receiving, by the document receiver, the GDI document sentfrom a document sender through an e-mail; or, receiving, by the documentreceiver, the GDI document sent from a document sender by logging on thenetwork terminal to the document sender.